import request from '../util/request'
// 查询医院列表
export function getHospitalApplyList (data) {
  return request({
    url: '/hospital-system/admin/apply-list',
    method: 'post',
    data: {
      currentPage: data.currentPage,
      hospitalName: data.hospitalName,
      pageSize: data.pageSize
    }
  })
}
// 拒绝医院申请
export function refuseHospitalApply (data) {
  return request({
    url: '/hospital-system/admin/refuse-apply',
    method: 'delete',
    data: {
      uuid: data.uuid,
      result: data.result
    }
  })
}
// 同意医院申请
export function passHospitalApply (data) {
  return request({
    url: '/hospital-system/admin/approval-apply',
    method: 'post',
    data: {
      uuid: data.uuid
    }
  })
}

// 检查药品名称/批准文号介绍
export function checkMedical (data) {
  return request({
    url: '/hospital-system/admin/medical-check',
    method: 'post',
    data: {
      name: data.name,
      approvalNumber: data.approvalNumber,
      uuid: data.uuid
    }
  })
}

// 新增药品
export function addMedical (data) {
  return request({
    url: '/hospital-system/admin/medical-add',
    method: 'post',
    data: {
      name: data.name,
      picture: data.picture,
      pictureName: data.pictureName,
      isOTC: data.isOTC,
      type: data.type,
      approvalNumber: data.approvalNumber,
      introduceHtml: data.introduceHtml
    }
  })
}

// 获取药品列表
export function getMedical (data) {
  return request({
    url: '/hospital-system/admin/medical-get',
    method: 'post',
    data: {
      currentPage: data.currentPage,
      pageSize: data.pageSize,
      name: data.name,
      isOTC: data.isOTC,
      type: data.type,
      approvalNumber: data.approvalNumber
    }
  })
}

// 删除药品
export function deleteMedical (data) {
  return request({
    url: '/hospital-system/admin/medical-delete',
    method: 'post',
    data: {
      uuid: data.uuid
    }
  })
}

// 根据药品uuid获取药品信息
export function getOneMedical (data) {
  return request({
    url: '/hospital-system/admin/medical-get-one',
    method: 'post',
    data: {
      uuid: data.uuid
    }
  })
}

// 根据药品uuid更新药品信息
export function updateMedical (data) {
  return request({
    url: '/hospital-system/admin/medical-update',
    method: 'post',
    data: {
      uuid: data.uuid,
      name: data.name,
      picture: data.picture,
      pictureName: data.pictureName,
      isOTC: data.isOTC,
      type: data.type,
      approvalNumber: data.approvalNumber,
      introduceHtml: data.introduceHtml
    }
  })
}
